<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<base href="<%=basePath%>">
<html lang="zn-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">

    <title>信息管理</title>
    <link rel="stylesheet" href="css/base.css?v=201709082019">
    <style type="text/css">
        .queryText2 {
            font-size: 12px;
            height: 20px;
        }

        .query_atradebal {
            margin-bottom: 10px;
        }

        #authorizeMemState{
            line-height: 30px;
            font-size: 14px;
            background: #65bcff;
            display: inline-block;
            padding: 0 15px;
            color: #fff;
            border-radius: 6px;
            margin: 0 auto;
        }
        #authorizeOrgState{
             line-height: 30px;
             font-size: 14px;
             background: #65bcff;
             display: inline-block;
             padding: 0 15px;
             color: #fff;
             border-radius: 6px;
             margin: 0 auto;
         }

        .finishBtn i {
            display: block;
            width: 50px;
            height: 50px;
            margin: 0 auto;
            border-radius: 50%;
            box-shadow: 0 7px 14px #91c5ff;
            background: url('img/qrcode1.png') no-repeat;
            background-size: 28.95px 20px;
            background-position: center;
            background-color: #91c5ff;
        }
        #exitGroup{
            margin-top: 10px;
            position: fixed;
            bottom: 10px;
            right: 20px;
            background-color: #44a4ff;
            font-size: 10px;
            z-index: 10;
            opacity: 0.5;
        }
        #cardMsg{
            margin-top: 20px;
            margin-bottom: 80px;
        }
        .finishBtn{
            position: fixed;
        }
        /*#cardMsg h2{*/
          /*height: 30px;*/
        /*}*/
        .mine_top_layer{
            padding: 5px;
            background-image: none;
        }
        .mine_top_layer img{
            /*border-radius: 0;*/
            /*box-shadow:none;*/
        }
        body{
            background: #f7f7f7;
        }
    </style>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/base.js"></script>
    <script type="text/javascript" src="js/common.js"></script>
    <script type="text/javascript" src="js/sha256.js"></script>
    <script type="text/javascript" src="js/sig.js"></script>
    <script type="text/javascript" src="js/handle.js"></script>
    <script type="text/javascript" src="js/ask.js"></script>
</head>
<body>
<div id="info"></div>
<div class="delay_readcard top20 bgf7">
    <div class="mine_top_layer">
        <img class="avatar" src="img/gr1.png" id="filePicker">
    </div>
    <div class="delay_readcard_top query_card_box">
        <input type="hidden" class="organizeType">
        <input type="hidden" class="memberNum">
        <h1 id="memberNum" class="query_num"></h1>
        <h2 class="query_type" >手机群录 · 成员信息</h2>
        <h3 class="query_atradebal" id="memState">
            <span id="authorizeMemState"></span>
        </h3>
        <h4 class="queryText"></h4>
    </div>
    <div class="delay_readcard_top query_card_box" id="cardMsg" >
        <h1 id="orgMark" class="query_num"></h1>
        <h2 id="delayType" class="query_type">手机群录 · </h2>
        <h3 class="query_atradebal" id="orgState">
            <span id="authorizeOrgState"></span>
        </h3>
        <h5 class="queryText2">
            <span id="depName" class="query_vpl">部门 · </span>
            <%--<span id="proName" class="query_enddate">职称 · </span>--%>
        </h5>
        <h5 class="queryText2">
            <span id="proName" class="query_vpl">职称 · </span>
        </h5>
        <h5 class="queryText2">
            <span id="tenueTime" class="query_vpl">成立 · </span>
        </h5>
        <h5 class="queryText2">
            <span id="joinTime" class="query_vpl">加入 · </span>
        </h5>
    </div>
    <div class="delay_readcard_finish">

        <div class="finishBtn">
            <i></i>
        </div>
    </div>
</div>
<span id="exitGroup" class="query_enddate circular_red" >退出组织</span>
<div class="mask_layer none">
</div>
<div class="toast toast_timeout" style="display:none">网络异常，请稍后重试！</div>
<div class="toast toast_error" style="display:none"></div>
<div class="loading" style="display:none">
    <img src="img/loading.gif"></div>
<script type="text/javascript">
    var oid = "${oid}"
    var textQr = "http://qr.topscan.com/api.php?text=JOIN_GROUP";
    $(function () {
        getOrgMemInfo(oid);
        $("#memState").on('click', function (e) {
            updateAuthorize(oid,"memAuth",function () {
                var memStr = $("#authorizeMemState").text();
                memStr = memStr == "信息已授权" ? "信息未授权" : "信息已授权";
                $("#authorizeMemState").text(memStr)
            })
        })
        $("#orgState").on('click', function (e) {
            updateAuthorize(oid, "orgAuth",function () {
                var orgStr = $("#authorizeOrgState").text();
                orgStr = orgStr == "信息已授权" ? "信息未授权" : "信息已授权";
                $("#authorizeOrgState").text(orgStr)
            })
        })
        $("#exitGroup").on('click', function (e) {
            if (confirm("确认要退出吗")) {
                unBindCard(oid, "inGroup", function () {
                    window.location.href = 'wxmp/group/toGroup'
                })
            }
        })

        $(".finishBtn i").click(function () {
            var organizeType = $(".organizeType").val();
            if (organizeType != 1) {
                errorToast("私有组织不允许分享", 2);
                return;
            }
            var memberNum = $(".memberNum").val();
            var text = '<div class="alert-box-with-btn">'
            var imgUrl = textQr + oid + "?fromUser=" + memberNum;
            console.log(imgUrl);
            text += '<img src="' + imgUrl + '">'
            text += '<p class="alert-box-btn">使用公众号内扫一扫菜单</p>'
            text += '</div>'
            $(".mask_layer").append(text).removeClass('none');
        })
        $(".mask_layer").click(function () {
            $(".mask_layer, .mask_layer > div").addClass('none');
        })
    })

</script>
</body>
</html>